int myAtoi(char * s){
    int a = 1;
    long temp = 0;
    int i = 0;
    while (s[i] == ' ')
    {
        i++;
    }
    if (s[i] == '-' || s[i] == '+')
    {
        a = 44 - s[i++];
    }
    while (s[i] >= '0' && s[i] <='9')
    {
        temp = temp * 10 + s[i++] - '0';
        if (temp != (int)temp) break;
    }
    temp *= a;
    return temp == (int)temp ? (int)temp : temp < 0 ? -2147483648 : 2147483647;
}